import 'package:appflutterhomeschool/common/common.dart';
import 'package:appflutterhomeschool/res/styles.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

///用户： ninetailedfox 
///时间： 2020/7/4
///邮箱： 1037438704@qq.com
///功能： listView的条目


class ItemCustomizationWidget extends StatelessWidget {

  final GestureTapCallback onTap;
  final bool visibleBool1,visibleBool2;
  final TextStyle textStyleBottom;


  ItemCustomizationWidget({this.onTap, this.visibleBool1, this.visibleBool2,this.textStyleBottom});

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: onTap,
      child: Container(
        height: ScreenUtil().setWidth(224),
        margin: EdgeInsets.only(
            top: ScreenUtil().setWidth(50),
            left: ScreenUtil().setWidth(35),
            right: ScreenUtil().setWidth(35)),
        child: Row(
          crossAxisAlignment: CrossAxisAlignment.start,
          mainAxisAlignment: MainAxisAlignment.start,
          children: [
            Container(
              width: ScreenUtil().setWidth(303),
              child:  Stack(
                children: <Widget>[
                  Container(
                    decoration: BoxDecoration(
                      borderRadius: BorderRadius.circular(10),
                      image: DecorationImage(
                        image: NetworkImage(Constant.nullImage),
                      ),
                    ),
                  ),
                  Positioned(
                    child: Container(
                      alignment: Alignment.center,
                      width: ScreenUtil().setWidth(60),
                      height: ScreenUtil().setWidth(40),
                      decoration: BoxDecoration(
                          color: Colors.red,
                          borderRadius: BorderRadius.only(
                            topLeft: Radius.circular(10),
                            bottomRight: Radius.circular(8),
                          )),
                      child: Icon(Icons.grade,color: Colors.white,size: ScreenUtil().setWidth(30),),
                    ),
                  )
                ],
              ),
            ),
            Expanded(
              child: Padding(
                padding: EdgeInsets.only(left: ScreenUtil().setWidth(37)),
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  mainAxisAlignment: MainAxisAlignment.start,
                  children: [
                    Text(
                      "英语之 “声” ——实用发音技巧轻松学",
                      style: TextStyles.textDark43,
                      maxLines: 2,
                      overflow: TextOverflow.ellipsis,
                    ),
                    Visibility(
                      visible: visibleBool1,
                      child: Padding(
                        padding:
                        EdgeInsets.only(top: ScreenUtil().setWidth(5)),
                        child: Text(
                          "简介：简介及娜姐递四方速递接，收方式范德萨范实用发音技巧轻松学",
                          maxLines: 1,
                          overflow: TextOverflow.ellipsis,
                          style: TextStyles.textGray30,
                        ),
                      ),
                    ),
                    Visibility(
                      visible: visibleBool2,
                      child: Padding(
                        padding:
                        EdgeInsets.only(top: ScreenUtil().setWidth(5)),
                        child: Text(
                          "00:23:20",
                          maxLines: 1,
                          overflow: TextOverflow.ellipsis,
                          style: textStyleBottom??TextStyles.textOrange30,
                        ),
                      ),
                    )
                  ],
                ),
              ),
            )
          ],
        ),
      ),
    );
  }
}


